/**
 * @Date: 2022-04-06 15:14:39
 * @LastEditors: sailornpg
 * @LastEditTime: 2022-04-23 16:38:55
 * @FilePath: \weibo-api\db\sync.js
 * @Description: 数据库同步
 */
const sequelize = require("./seq");
require("../model/index");
async function con() {
  try {
    await sequelize.authenticate();
    console.log("sequlize连接成功");
  } catch (error) {
    console.error(error);
    console.error("sequlize连接失败，原因:", error);
  }
}
con();
//同步
async function sync() {
  await sequelize.sync({
    force: true,
  });
  process.exit();
}
sync();
